#include <stdio.h>
void FindKey(int a[5][5],int key){
    int column=4,row=0;
    int tag=0;
    while(column>-1&&row<5&&key-a[row][column]){
        if(key<a[row][column]){
            column--;
        } else if(key>a[row][column]){
            row++;
        }
        if(key==a[row][column]) {
            printf("%d %d", row, column);
            tag=1;
            break;
        }
    }
    if(!tag){
        printf("NotFound!");
    }
}
int main(){
    int key;
    scanf("%d",&key);
    int a[5][5]={{1,3,5,7,9},{2,4,6,8,10},{11,13,15,17,19},{12,14,16,18,20},{21,23,25,27,29}};

    FindKey(a,key);
}